<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsps/include.jsp"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>显示题目</title>
<link href="<%=basePath%>css/ls1.css" rel="stylesheet" type="text/css" />
<link href="<%=basePath%>images/skin.css" rel="stylesheet" type="text/css" />
<link href="<%=basePath%>css/box.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<script type="text/javascript"  src="<%=basePath%>js/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	
});
</script>




</head>
<body>

	<table width="100%" border="0" cellpadding="0" cellspacing="0"  class="tab1">
  <tr>
    <td width="17" valign="top" background="<%=basePath%>images/mail_leftbg.gif"><img src="<%=basePath%>images/left-top-right.gif" width="17" height="29" /></td>
    <td valign="top" background="<%=basePath%>images/content-bg.gif"><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
      <tr>
        <td height="31"><div class="titlebt">显示新题目</div></td>
      </tr>
    </table></td>
  </tr>
</table>
<form:form modelAttribute="graduateProject" action="${action}">
题目名称：<form:textarea path="title"></form:textarea><br>
题目类型：<form:select path="projectType"  id="projectTypes">
<option>--请选择--</option>
<c:forEach items="${projectTypes}" var="projectTypes">
<form:option value="${projectTypes.id}">${projectTypes.description }</form:option>
</c:forEach>
</form:select><br>
题目来源：<form:select path="projectFrom"  id="projectFroms">
<option>--请选择--</option>
<c:forEach items="${projectFroms}" var="projectFroms">
<form:option value="${projectFroms.id }">${projectFroms.description }</form:option>
</c:forEach>
</form:select><br>
限选专业：

 <form:select path=""  id="schools">
							<option>--请选择--</option>
							<c:forEach items="${schools}" var="schools">
								<form:option value="${schools.id}">${schools.description}</form:option>
							</c:forEach>
						</form:select>
						<form:select path=""  id="departments">
							<form:option id="departments" value="0">--请选择--</form:option>
						</form:select>
						<form:select path=""   id="majors">
							<form:option id="majors" value="0">--请选择--</form:option>
						</form:select><br>




年份：<form:textarea path="year"  rows="1" cols="5" /><br>
题目简介及对学生的要求：
<form:textarea  path="introduction"  rows="1" cols="5" /><br>

<a href="../process/submitPaperProject.html?major_id=${major_id }">论文提交</a>&nbsp;&nbsp;
<a href="../process/submitDesignProject.html?major_id=${major_id }">设计提交</a>&nbsp;&nbsp;
<a href="../process/addProject.html">取消</a>  



</form:form>


<script type="text/javascript">
	//获取School的id
	$("#schools").change(function(){
	
		$.ajax({type:"get",
			url:"<%=basePath%>process/departmentList.html",
			dataType:"json",
			data:"id="+$("#schools").val()
			})
		//使用done()方法添加“执行成功”的回调函数
			.done(function(data, statusText) {
				$("#departments").empty();
				$("#departments").append("<option value='"+ 0 + "'>--请选择--</option>");
				var num = data.departmentList.length;
				for(i = 0; i < num ; i++ ){
					$("#departments").append("<option value='"+ data.departmentList[i].id + "'>" + data.departmentList[i].description + "</option>");
				}
			})
			.fail(function() {
				
			});		
		});

	

	</script>
	<script type="text/javascript">
	//获取department的id
	$("#departments").change(function(){

		$.ajax({type:"get",
			url:"<%=basePath%>process/majorList.html",
												dataType : "json",
												data : "id="
														+ $("#departments")
																.val()
											})
									//使用done()方法添加“执行成功”的回调函数
									.done(
											function(data, statusText) {
												$("#majors").empty();
												$("#majors")
														.append(
																"<option value='"+ 0 + "'>--请选择--</option>");
												var num = data.majorList.length;
												for (j = 0; j < num; j++) {
													$("#majors")
															.append(
																	"<option value='"+ data.majorList[j].id + "'>"
																			+ data.majorList[j].description
																			+ "</option>");
												}
											}).fail(function() {
   												
									});
						});

	
	
	</script>

















    
</body>
</html>
